package com.ctg.payroll2.action.payment;

import com.ctg.payroll2.action.BaseAction;
import com.ctg.payroll2.bean.filter.payment.PbSysfunctionFilter;
import com.ctg.payroll2.service.payment.PbSysfunctionService;
import com.ctg.payroll2.util.Constants;
import com.ctg.platform.util.Page;
import com.ctg.platform.util.Parse;

public class PbSysfunctionAction extends BaseAction {
	private static final long serialVersionUID = -26290732624685390L;
	private PbSysfunctionService service;
	private PbSysfunctionFilter filter;
	private Page result;
	private int flag;

	/**
	 * @param service 设置service
	 */
	public void setService(PbSysfunctionService service) {
		this.service = service;
	}

	@Override
	protected void createEntity() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void deleteEntity() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void queryEntity() {
		if (filter == null) {
			filter = new PbSysfunctionFilter();
		}
		filter.setStartIndex(Parse.toInteger(request.getParameter(Constants.START), 0));
		filter.setEndIndex(Parse.toInteger(request.getParameter(Constants.LIMIT), Constants.DEFAULT_PAGE_SIZE));
		
		filter.setCompanyCode(currentUser.getCompanyCode());
		switch (flag) {
		case 1:
			result=service.getPbSysfunctionListByType(filter);
//			System.out.print("");
			break;
		case 2:
			result=service.querypbSysfunctionBySocialFilter(filter);
//			System.out.print("");
			break;
		default:
			break;
		}
	}

	@Override
	protected void retrieveEntity() {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void updateEntity() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void commonOperations() {
		logger.debug("进入了commonOperations!");
	}

	@Override
	protected void exportXLS() {}

	public PbSysfunctionFilter getFilter() {
		return filter;
	}

	public void setFilter(PbSysfunctionFilter filter) {
		this.filter = filter;
	}

	public Page getResult() {
		return result;
	}

	public void setResult(Page result) {
		this.result = result;
	}

	public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}
}
